<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * LiteCommerce
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to licensing@litecommerce.com so we can send you a copy immediately.
 *
 * @category   LiteCommerce
 * @package    XLite
 * @subpackage Model_Proxy
 * @author     Creative Development LLC <info@cdev.ru>
 * @copyright  Copyright (c) 2011 Creative Development LLC <info@cdev.ru>. All rights reserved
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link       http://www.litecommerce.com/
 * @see        ____file_see____
 * @since      1.0.0
 */

namespace XLite\Model\Proxy;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE
 *
 * @package    XLite
 * @see        ____class_see____
 * @since      1.0.0
 */
class XLiteModelModuleProxy extends \XLite\Model\Module implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * _entityClass
     *
     * @var    string
     * @access protected
     * @see    ____var_see____
     * @since  1.0.0
     */
    protected $_entityClass;

    /**
     * _entityPersister
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_entityPersister;

    /**
     * _identifier
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_identifier;

    /**
     * __isInitialized__
     *
     * @var    mixed
     * @access public
     * @see    ____var_see____
     * @since  1.0.0
     */
    public $__isInitialized__ = false;

    /**
     * __construct
     *
     * @param mixed $entityPersister ____param_comment____
     * @param mixed $identifier      ____param_comment____
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
        $this->_entityClass = 'XLite\Model\Module';
    }

    /**
     * _load
     *
     * @return void
     * @access private
     * @see    ____func_see____
     * @since  1.0.0
     */
    private function _load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                return;
            }
            unset($this->_entityPersister);
            unset($this->_identifier);
        }
    }

    
    public function getMainClass()
    {
        $this->_load();
        return parent::getMainClass();
    }

    public function callModuleMethod($method, $result = NULL, array $args = array (
))
    {
        $this->_load();
        return parent::callModuleMethod($method, $result, $args);
    }

    public function getActualName()
    {
        $this->_load();
        return parent::getActualName();
    }

    public function getVersion()
    {
        $this->_load();
        return parent::getVersion();
    }

    public function hasIcon()
    {
        $this->_load();
        return parent::hasIcon();
    }

    public function getSettingsForm()
    {
        $this->_load();
        return parent::getSettingsForm();
    }

    public function getDependencyModules()
    {
        $this->_load();
        return parent::getDependencyModules();
    }

    public function getDependentModules()
    {
        $this->_load();
        return parent::getDependentModules();
    }

    public function isFree()
    {
        $this->_load();
        return parent::isFree();
    }

    public function isPurchased()
    {
        $this->_load();
        return parent::isPurchased();
    }

    public function isCustom()
    {
        $this->_load();
        return parent::isCustom();
    }

    public function getLicenseKey()
    {
        $this->_load();
        return parent::getLicenseKey();
    }

    public function getCurrency()
    {
        $this->_load();
        return parent::getCurrency();
    }

    public function isInstalled()
    {
        $this->_load();
        return parent::isInstalled();
    }

    public function getIdentityData()
    {
        $this->_load();
        return parent::getIdentityData();
    }

    public function getMarketplaceID()
    {
        $this->_load();
        return parent::getMarketplaceID();
    }

    public function getModuleID()
    {
        $this->_load();
        return parent::getModuleID();
    }

    public function setName($name)
    {
        $this->_load();
        return parent::setName($name);
    }

    public function getName()
    {
        $this->_load();
        return parent::getName();
    }

    public function setAuthor($author)
    {
        $this->_load();
        return parent::setAuthor($author);
    }

    public function getAuthor()
    {
        $this->_load();
        return parent::getAuthor();
    }

    public function setEnabled($enabled)
    {
        $this->_load();
        return parent::setEnabled($enabled);
    }

    public function getEnabled()
    {
        $this->_load();
        return parent::getEnabled();
    }

    public function setInstalled($installed)
    {
        $this->_load();
        return parent::setInstalled($installed);
    }

    public function getInstalled()
    {
        $this->_load();
        return parent::getInstalled();
    }

    public function setDate($date)
    {
        $this->_load();
        return parent::setDate($date);
    }

    public function getDate()
    {
        $this->_load();
        return parent::getDate();
    }

    public function setRating($rating)
    {
        $this->_load();
        return parent::setRating($rating);
    }

    public function getRating()
    {
        $this->_load();
        return parent::getRating();
    }

    public function setVotes($votes)
    {
        $this->_load();
        return parent::setVotes($votes);
    }

    public function getVotes()
    {
        $this->_load();
        return parent::getVotes();
    }

    public function setDownloads($downloads)
    {
        $this->_load();
        return parent::setDownloads($downloads);
    }

    public function getDownloads()
    {
        $this->_load();
        return parent::getDownloads();
    }

    public function setPrice($price)
    {
        $this->_load();
        return parent::setPrice($price);
    }

    public function getPrice()
    {
        $this->_load();
        return parent::getPrice();
    }

    public function setCurrency($currency)
    {
        $this->_load();
        return parent::setCurrency($currency);
    }

    public function setMajorVersion($majorVersion)
    {
        $this->_load();
        return parent::setMajorVersion($majorVersion);
    }

    public function getMajorVersion()
    {
        $this->_load();
        return parent::getMajorVersion();
    }

    public function setMinorVersion($minorVersion)
    {
        $this->_load();
        return parent::setMinorVersion($minorVersion);
    }

    public function getMinorVersion()
    {
        $this->_load();
        return parent::getMinorVersion();
    }

    public function setRevisionDate($revisionDate)
    {
        $this->_load();
        return parent::setRevisionDate($revisionDate);
    }

    public function getRevisionDate()
    {
        $this->_load();
        return parent::getRevisionDate();
    }

    public function setPackSize($packSize)
    {
        $this->_load();
        return parent::setPackSize($packSize);
    }

    public function getPackSize()
    {
        $this->_load();
        return parent::getPackSize();
    }

    public function setModuleName($moduleName)
    {
        $this->_load();
        return parent::setModuleName($moduleName);
    }

    public function getModuleName()
    {
        $this->_load();
        return parent::getModuleName();
    }

    public function setAuthorName($authorName)
    {
        $this->_load();
        return parent::setAuthorName($authorName);
    }

    public function getAuthorName()
    {
        $this->_load();
        return parent::getAuthorName();
    }

    public function setDescription($description)
    {
        $this->_load();
        return parent::setDescription($description);
    }

    public function getDescription()
    {
        $this->_load();
        return parent::getDescription();
    }

    public function setIconURL($iconURL)
    {
        $this->_load();
        return parent::setIconURL($iconURL);
    }

    public function getIconURL()
    {
        $this->_load();
        return parent::getIconURL();
    }

    public function setPageURL($pageURL)
    {
        $this->_load();
        return parent::setPageURL($pageURL);
    }

    public function getPageURL()
    {
        $this->_load();
        return parent::getPageURL();
    }

    public function setAuthorPageURL($authorPageURL)
    {
        $this->_load();
        return parent::setAuthorPageURL($authorPageURL);
    }

    public function getAuthorPageURL()
    {
        $this->_load();
        return parent::getAuthorPageURL();
    }

    public function setDependencies($dependencies)
    {
        $this->_load();
        return parent::setDependencies($dependencies);
    }

    public function getDependencies()
    {
        $this->_load();
        return parent::getDependencies();
    }

    public function setFromMarketplace($fromMarketplace)
    {
        $this->_load();
        return parent::setFromMarketplace($fromMarketplace);
    }

    public function getFromMarketplace()
    {
        $this->_load();
        return parent::getFromMarketplace();
    }

    public function map(array $data)
    {
        $this->_load();
        return parent::map($data);
    }

    public function __get($name)
    {
        $this->_load();
        return parent::__get($name);
    }

    public function __set($name, $value)
    {
        $this->_load();
        return parent::__set($name, $value);
    }

    public function __unset($name)
    {
        $this->_load();
        return parent::__unset($name);
    }

    public function getRepository()
    {
        $this->_load();
        return parent::getRepository();
    }

    public function checkCache()
    {
        $this->_load();
        return parent::checkCache();
    }

    public function detach()
    {
        $this->_load();
        return parent::detach();
    }

    public function __call($method, array $args = array (
))
    {
        $this->_load();
        return parent::__call($method, $args);
    }

    public function isPersistent()
    {
        $this->_load();
        return parent::isPersistent();
    }

    public function update()
    {
        $this->_load();
        return parent::update();
    }

    public function create()
    {
        $this->_load();
        return parent::create();
    }

    public function delete()
    {
        $this->_load();
        return parent::delete();
    }

    public function cloneEntity()
    {
        $this->_load();
        return parent::cloneEntity();
    }

    public function prepareEntityBeforeCommit()
    {
        $this->_load();
        return parent::prepareEntityBeforeCommit();
    }


    /**
     * __sleep
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __sleep()
    {
        return array('__isInitialized__', 'moduleID', 'name', 'author', 'enabled', 'installed', 'date', 'rating', 'votes', 'downloads', 'price', 'currency', 'majorVersion', 'minorVersion', 'revisionDate', 'packSize', 'moduleName', 'authorName', 'description', 'iconURL', 'pageURL', 'authorPageURL', 'dependencies', 'fromMarketplace');
    }

    /**
     * __wakeup
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __wakeup()
    {
        if (isset($this->_identifier)) {
            foreach ($this->_identifier as $k => $v) {
                $this->$k = $v;
            }

            \Xlite\Core\Database::getEM()->getUnitOfWork()->removeFromIdentityMap($this);
            $this->_entityPersister = \XLite\Core\Database::getEM()->getUnitOfWork()->getEntityPersister($this->_entityClass);
        }
    }
}